<?php

namespace App\Models\Mengborun;

// use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use App\Models\BaseModel;

class User extends BaseModel implements AuthenticatableContract, JWTSubject
{
	use  Authenticatable;
	protected $table = 'mb_user';

	public function userAddress()
	{
//		return $this->HasOne(UserAddress::class, "user_id", "id");
		return $this->HasOne(UserAddress::class);

	}

	public function point()
	{
		return $this->HasOne(UserPoint::class, "user_id", "id");
	}

	// jwt 需要实现的方法
	public function getJWTIdentifier()
	{
		return $this->getKey();
	}
	// jwt 需要实现的方法
	public function getJWTCustomClaims()
	{
		return [];
	}
}